home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / pipeline / 6_10 / WineList / ReadMe < prev    next >
Encoding:
Text File  |  1992-10-11  |  1.4 KB  |  39 lines

  1. %OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938 
  2. %OP%DP0
  3. %OP%IRY
  4. %OP%PL0
  5. %OP%HM0
  6. %OP%FM0
  7. %OP%BM0
  8. %OP%LM4
  9. %OP%PT1
  10. %OP%PDPipeLine
  11. %OP%WC1026,2262,188,1748,0,0,0,0
  12. %CO:A,72,72%
  13. %C%Nested Ifs and Lookup tables
  14. %C%by Gerald L Fitton
  15. Keywords:
  16. NestedIf Lookup Custom Fitton
  17.  
  18. This short application arose from some correspondence about testing 
  19. multiple conditions with Ian Masterton.  His interest is to return 
  20. values such as "White" or "Red" (wine) when the input is such words as 
  21. "Claret" or "Medoc".
  22.  
  23. The first technique is that of nested ifs as illustrated by the file 
  24. [IfItIs].  It is suitable only when the number of conditions is small.  
  25. When the application would lead to many complicated 'nested ifs' then a 
  26. better approach is to use a custom function containing a lookup list.
  27.  
  28. Such an approach was explained in the directory Custom03 on the 
  29. AugustĀ 1992 PipeLineĀ 4 disc and it is illustrated by [WineCellar] and 
  30. its custom function [c_Wine].  To see this second method in operation 
  31. double click on the file [WineCellar].  Both [WineCellar] and the 
  32. custom function [c_Wine] will open.  The custom function uses the 
  33. lookup functions and lookup tables within it.  The result is returned 
  34. to slots in [WineCellar].
  35.  
  36. Note the ^# at the end of each lookup table.  The ^# matches anything 
  37. which is not found in the lookup table and returns an 'error message' 
  38. to the slot from which the custom function is called.
  39.